import request from '@/utils/request'

/** 客户池  */
export function customerPoolList(query) {
  return request({
    url: '/customerPool/customerPoolList',
    method: 'get',
    params: query
  })
}

/** 本级客户池  */
export function sameLevelPoolList(query) {
  return request({
    url: '/customerPool/sameLevelPoolList',
    method: 'get',
    params: query
  })
}

/** 下级客户池  */
export function lowerLevelPoolList(query) {
  return request({
    url: '/customerPool/lowerLevelPoolList',
    method: 'get',
    params: query
  })
}

/** 获取用户信息  */
export function getUserList(query) {
  return request({
    url: '/customerPool/getUserList',
    method: 'get',
    params: query
  })
}

/** 获取当前登录人下级部门信息  */
export function getDeptList(query) {
  return request({
    url: '/customerPool/getDeptList',
    method: 'get',
    params: query
  })
}

/** 获取部门信息  */
export function getDeptInfoList(query) {
  return request({
    url: '/customerPool/getDeptInfoList',
    method: 'get',
    params: query
  })
}


/** 分配客户给下级池  */
export function allotCustomerToDept(data) {
  return request({
    url: '/customerPool/allotCustomerToDept',
    method: 'post',
    data: data
  })
}

/** 分配客户给指定用户  */
export function allotCustomerToUser(data) {
  return request({
    url: '/customerPool/allotCustomerToUser',
    method: 'post',
    data: data
  })
}

/** 退回到上一级部门  */
export function returnCustomer(data) {
  return request({
    url: '/customerPool/returnCustomer',
    method: 'post',
    data: data
  })
}

/** 上级客户池  */
export function superiorCustomerList(query) {
  return request({
    url: '/customerPool/superiorCustomerList',
    method: 'get',
    params: query
  })
}


/** 拉取上级客户 */
export function deptPoolPull(data) {
  return request({
    url: '/customerPool/deptPoolPull',
    method: 'post',
    data: data
  })
}

/** 拉取上级客户 */
export function checkStatus(data) {
  return request({
    url: '/customerPool/checkStatus',
    method: 'post',
    data: data
  })
}

/** 下载导入模板 */
export function downloadTemplate() {
  return request({
    url: '/customerPool/importTemplate',
    method: 'post'
  })
}
/** 批量退回到公海 */
export function bathReturnTotalCutomer(data) {
  return request({
    url: '/customerPool/bathReturnTotalCutomer',
    method: 'post',
    data: data
  })
}
